Fix a bug of boundary-repair