tensor: fixes to insert