fixing up ranges that don't end