Merge pull request #40 from kainx/master

Merge fixes from 4.2.0 into master