Fixed issue with finalize_session not being required