Added finally clause to unit testing.