Used copyIfNeeded where appropriate.