Fix freeze on end game animation, clean some code, minor improvements
