Squash of @alapolloni 's PR

Fixes #100 and #102