Improve value parsing