Fixed SP compiling for Mac (and hopefully Linux too). Fixes #240.