Fixed the nasty bug that crashed ipad and iphone.