Avoid casting invalid value to enum reply_type