Fixes some bugs in views