Improving Autoformalization using Type Checking