Simplify analysis process termination a bit.

Makes use of *finally* block being run regardless of whether function runs till end of its code or exits in the middle to simplify code a bit.