Fixup module initialization methods and add return value checking.