Fixed testing bugs