Fix incorrect error flag.