minor fixes to some parts of DAO and views.py