fix ps_convert function. reported by Ryan Hass