various fixes and formating for ios 6