Fix buf in string -> int conv.