Patch for error in views.py and other minor amends.