Merged in changes from the Horton branch.