Fixes for gcc-4.7

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