Fixed slight bound check error