Various compile fixes for Linux