Better check for UID. Refs. #367