Couple of fixes to views.py