Re-rolled patch #4. Attached interdiff for the same. Please review.