Misc small fixes making it compile nicely on CentOS.