Re-rolled patch #19. Attached interdiff for the same.
#8 was re-rolled by Kap...