fixed a bug in getRangesForMatch with zero length matches