CRM-15979 changes as suggested by totten