Additional fixes to prevent duplicate user entries.