Fix try finally bugs