RHEL5 support

Some mods to make this build on RHEL5.