Fixed a compile warning for an unchecked cast.