Minor bug fixes & Includes PR #62 from @rakoo

- Includes #62
- Var scoping issue + a fix to make jshint happy (ya'll should use it!).