Fix indexing bug in Parser