Fixed some bugs with views