Issue #240, added more tests