Fix for issue 17

This PR fixes #17. 
To test, run:
`$ node ./test/issue14.js` (filename is a typo)