fixes #2571 and testsuite
cleanup
Merge pull request #2625 from digi604/fix-2571

fixes #2571 and testsuite