Fixed exception error logging