made some ios5 / xcode4.2 compatibility edits