Fixes regression with --max-items.