Merged in final changes from amerish.