Fix some index errors in a logging message. Profile dict was being copied on the wrong place.