Sprite drawing bugs finally fixed