Fixed bug in View.add_view, added unittests for View