Patches to fix email bug in API.