Issue 20040: bug fixes