Fixed hoisting bug and TS compilation issue
Merge pull request #12 from anderaus/master

Fixed hoisting bug and TS compilation issue