MIF-MID fixed several bugs by applying missed fix from other branches.