Improved user and group mapping for better search by prefix.