Fix some bugs in view.
closes #34