Fixed a bug with Events.off