Address Linux incompatibilities

Tested on Ubuntu 12.04.