#285 some changes
Issue #285 add more tests