Exit on error fixed

To comply with python doc
Email layout correction