Fix some error logging