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