Fixes for gcc-4.7

These changes fix a few compile errors seen on Fedora 18 (gcc 4.7.2)