bugfixes, game loop and sprite improvements