Fixes to get saving of targets working