Merge pull request #1 from maciek-slon/master

Merge
ported to v.3
Merge pull request #2 from mlaszko/master

ported to v.3
fix