add tests for #321