Add tests for #2817