Fixes for Linux and various other small fixes