Some code fix in views, forms and templates