some fixes in format()

Hi,

these are some fixes I have laying around on my hard disk since 1994.

The second one is kind of obvious, I don't remember the reason for the first change. If I dig hard enough I might be able to find some sc files which exhibit an error without the change.