Add diagnostics for type checking errors

The calls to file systems are deferred until the main ones fail.