Fix deprecation warnings in tests
Remove unused-but-set warnings in unfinshed code