Fixes needed for new g++

Hi,

I ran into some compiler errors using g++ 4.7.3 (ubuntu raring). This is how I dealt with them. I didn't do thorough testing, but it does compile now. Hope this is helpful.

Thanks,
Tom