Correct error handling in parse_ulong()