Correct an off-by-one error in get_sub_items

Also add some meta.