fix pgtol conversion