Added select for relations.
= Also fixed up some things in project.