fixing tests error and warnings