Squash of @alapolloni 's PR

Fixes #100 and #102
Merge pull request #108 from maebert/#100

Squash of @alapolloni 's PR