More compile fixes, and better support for older compilers.