Add more tests and fix deprecated error.