Fix type casting.