Use memmove on overlapping regions, and operate with correct sizeof()