Fixed events issue and hardened test cases