Fix missing assert_equals( and use a different way to trigger error event