fix value parsing routine