fixes to allow compilation on mac os x 10.10