Fixed junit test and warnings