Fixes and improvements.
Fix for Xcode 6 beta 7.