Error logging improvement.