Fixed event looping.
Merge branch 'dev'