Fix to main build loop.