fixes #2571 and testsuite

fixes #2571