Fixed build errors on Xcode 6.1. Apple has changed some return types etc, which caused the errors