fixes for compiling on a mac