Fix: a bug in returning enum symbols when their is inferred as "any";
Fix: a couple of minor memory leaking bugs.