Submitted patch with backwards compatibility for bug 940554