Cleanup and fix Linux compilation