Fixed index out of range error when trying to get the next or previous error before check syntax had been called