Fix some tests and cleanup backport code.