Added framerate limit and fixed window resizing issues.