Tested on Precise x86, Quantal x64, Raring x64 and FreeBSD 9 x64. Closes #4