Fixed some bugs regarding the trial type D and E