fix NPEs the correct way, in the module