various fixes. more tests