Fix bug in submission creation.
Add method for logging exceptions