Minor cleanup and optimization to check fewer FKs.