Fixed some testing bugs