Nil is defined as NULL on OSX.

Right now this fixes the OS X build. You may want to simply change the nil variable name, if so I'll let you choose what you prefer.