Fix border case with gap of length 1