Resolves issues #31, #15.
Merge pull request #32 from dgsan/master

Resolves #31, #15