Fix compile issues with g++4.2

These are minor changes I had to make to get things compiling on OS X. I'm not sure if this will affect other platforms.