Fix thrown NameError