Several fixes for building on Linux.