Patch by Doug Newgard <scimmia22@outlook.com> SVN revision: 82148
SVN revision: 47822
SVN revision: 41355