Fix Python 3
Fix NameError