fix panics with incorrectly cast *ast.Ident