Added changes from Issue 575.