fix #931 and few more tests