Ok, here is the patch again, sorry for the hiccup. I rectified also the commit message, to reflect latest changes.