minor bug fixes + more tests + documentation edits