Merge pull request #202 from brunck/master

Fixing #171, #174, #192, #193