Multiple fixes for Linux