Fix a memory leak.
Mute some warnings on OSX.