Make some fixes to associations, query methods calling and update_attributes attrs setting