ugly workaround for bug introduced by the format string cleanups

Better would be for ret to be passed down as a signed long, but
this at least fixes things for now.