Fixed weird generation event bug
Merge origin/master