Build-system fixes