Fixed some issues for unit tests