fixed bug that allowed invalid programs to appear to typecheck and evaluate