plugged some index errors in the parser