Fix for #2024

This PR should fix #2024.

Replaces #2171.
it_does_nothing_if_there_are_no_items