Fixes issue #51

I don't actually know _any_ JS, so you should check it.