Prevent a potential NPE
Some formatting improvements
Don't typecheck files outside source roots since package/module is unknown