Ugly fixes for linux