bug fixes
Merge pull request #423 from nelenkov/dev

bug fixes