Fix bugs in view, work in progress.