bad search&replace in generator.cpp