Fix type cast