Fix resource copy