Adding relationship and fix entity.