Fixing local variable error (issue #11) and JSON return issue that caused problems with numbers (issue #9)