Merged in version from amerish branch.