Fixes #173.
Merge pull request #175 from jpav/master

Fixes #173.
Fixes #166
Merge pull request #176 from jpav/master

Fixes #166