Fixed broken type cast.