Fixes in mail handler