Applying @tetraf's patch. Closes #31.

I'm trusting the @tetraf's test.