Fixes for compiling on Ubuntu

Worked on 12.10