Incorporate changes from the latest release by Mike Saltzman