Fixed redefining of constant error.
Made sending of emails clean from spurious error messages.