Add more tests, fix issues, see #2895