Fix Bug: Swapped arguments in clone

Issues were being caused by swapped arguments, data and type were being
switched always.