tests for #314
more tests for #314
fix #314