Better handling of uid mappings