Merge "Fix NPE when UID doesn't exist." into pi-dev