petea - fixed bug in parse function