Fixes and improvements

 - Fixed a login redirection problem
 - fixed links on related data foreign keys in "view" view.