Updating Custom event declaration mode.
Fixing minor bugs for tests.