Add tests to verify fixes for #18