tests for #315
fix #315