Fix NameError in inrecords.py