Add some tests and assertions. Fix select_related