Extended main program to enforce module definition rules and fixed existing modules to meet that criteria