Fix memgen.py.