Miscellaneous fixes for stuff that broke in Linux