Fixes #40 and #41. Thanks @vikhyat
Merge pull request #44 from Kenshii/master

Fixes #40 and #41. Thanks @vikhyat