Fix bugs in md.tpl