Fixes for Linux 64bit

fixes compile errors, tested on Ubuntu 13.10