Fix bugs in using md structure