dm clone: Add missing casts to prevent overflows and data corruption