Xcode5 compatibility

More improvements to add to prior commit.