Fixed invalid cast when processing error msgs