Fixed bugs in the view