fixes #2588 and testsuite