Reimplement changes to listeners.
Catch possible IndexOutOfRange/NPE with invalid use of flag tag.