Fix warnings and tests
Fix warnings and tests