Defensive copy

Change-Id: Ib1778ab4fd19de32e8fde2939a432c6f1ce375de