Fix invalid cast in read attribute list