Fixed bugs.
Added auto close option for views in unit tests.