fixed numerous compiler warnings on OSX