Fixes to allow proper rebuild on linux