Fixed inline mmd generation and related scope issue.