Add unit test for #1227