Fixed some code in unit tests