Fixed to work when data doesn’t include end column

(as per @rgrp’s suggestion on the mailing list)