metagrammar fix, loop detector (hack)