Fixed tests and some warnings