Fixed a couple problems with the gameloop. Framework will be overhauled