- Patch from Aravind Parchuri <aravind.parchuri@gmail.com> with some my modifications: