Based on a patch by Roman Yeryomin <roman@advem.lv> SVN-Revision: 27990
Based on a patch by: Sergiy <piratfm@gmail.com> SVN-Revision: 27812