Added type checking to try/catch/finally statements