Fix bugs caused by different datasets