Fix generation for static relations.