fix typeof bug and clarify some error messages
fix panic when main undeclared
import more examples