fix error and test
Merge pull request #65 from lensky84/12397_fix_error_and_tests

fix error and test