PR: 6889 Submitted by: Andrey Zakhvatov <andy@icc.surw.chel.su>
PR: 6165 Submitted by: Andrey Zakhvatov <andy@icc.surw.chel.su>