Added error queue clearing to *CLS callback function