Add a unit test for #370