Add unit test for #590