Fixed assertion conditions in the test. Part of #2347.