issue #21229: bugfix to REST count