Modified amend-record so that it won't modify a closed record.  Added some docstrings.