Fixing tests and warnings