Fixing tests

See #473.
Merge branch 'bessarabov-fixing_tests'