Fixed source and destination being the wrong way round in memcpy() statements