Added changes from bug 1042525