Event handling partially fixed, readded into game loop