Fixed bugs of codec error.