[fix] Ensure that tags are properly set before appending to them.