fixes to build on linux
http://bazaar.launchpad.net/~openpetracore/openpetraorg/trunkhosted/revision/2238