Fixed some bugs in views