Add test for and fix #15