Improve debug logging
Add long version of command line arguments
Fix issue when email notification is disabled