Added precondition checks on the modules.