Starting unit test and fixing bug