Fixed unit testing defects