Fix off-by-one error causing anti-mining protection ineffective