Fixed wrong module dispose/teardown function calls