Fixed clang-specific errors on OS X
Small fixes and cleanup