bug fixes, updated to work with Xcode 6.1