Fixed "AttributeError: on_get_flags" error.