fix #213 : added test, merge to master after review