many fixes to issue 31