Add cast to correct unmatched type issue found by AppCode