Fixing bug 4219 and bug 4220