PutFile: Fix duplicated/unordered groups

Note: users have to manually syncronize key and path now!