Fixed compiler errors to make it compile on Xcode 6 dp5.