PR: 6887 Submitted by: Andrey Zakhvatov <andy@icc.surw.chel.su>
PR: 6166 Submitted by: Andrey Zakhvatov <andy@icc.surw.chel.su>