Corrcted a bug when running the module as a standalone script.