Minor changes to checkIdentity and SQL.