improving #113 test
Add unit test for #306
Implement #306