fix some errors for forms which don't display foreign key attribute properly