fix more compiler warnings, based on a patch by Rainer Keller