Typecheck format2

(This sits on top of the build_stats PR)