fixed bug #2679
Merge pull request #280 from vpisarev:bug_fixes_jan9