Ubuntu 12 build fixes