Some fixes for Linux compatibility