Xcode 5 compatiblity and minor improvements