Added overflow protection to parser offsets