Fix a boundary check error.