Add tests. Fix Database.load