Bug fixing in unit tests (#306)