Fix manual array copy