Fixes to avoid endless rebuilding.