compile fixes for OSX