Fix tests error on finally