Fixes to logs and exceptions