Fix NameError
Fix local variable not defined
Merge pull request #1 from jordelver/master

Fix some stuff