Revert "removed a NameError: cannot remove ... like Stephan said"

This reverts commit c6a4fa6018f2773f93e0a7e7422f0a3b967a8199.
Revert "Fixes for maglevrecord."

This reverts commit 40d203c1785a6ef97c31f9111a4afe60391038bb.