Re-phrase to avoid index out-of-range

I got an index out of range on both empty box contents and non-empty one. Didn't look into why, but this patch seems to avoid it.