Fixing compile errors on OS X (GCC & Clang)