quick-n-dirty fix for #515
Merge pull request #517 from nelenkov/dev

quick-n-dirty fix for #515