Fixed cleanup_bindings() and added tests for fire_event