cleaned up version of the patches from bug 304728 and bug 304729 (second strategy).
4 files changed