Merge "Improve codegen slightly when doing FD validity checks"