Fixing tests and build