Restore memset and fix memmove

Your revert memmove my implementation commit also removed memset so I added the old code back in. As for memmove, this commit fixes the comparisons and also removes all compiler warnings for memmove.