format fixups and some fprint magic