Fixed some rAF issues in events.js