Fix/exception logging

@turicas