Fixed some MdToUBB bugs