Fixed exception logging