fixed for OSX compilation
fixes for OSX