Fixed parsing

(because i was dumb enough to think substr in c++ was (pos1, pos2) and
not (pos, length) )