Many build fixes that turned up with GCC 4.6.