Initialize pos to 0 before each conversion, in case they fail with exceptions.