fix more warnings on BSD/OSX