Xcode6 compilation fixes

Xcode 6 doesn't like using nil when you mean 0.