Fixes for linux
Improved build system