#385 refactored
#385 fixed
Merge pull request #405 from krzyk/385

#405: pull request 385