Fix compilation problems on OS X Lion and Mountain Lion.