Support table->enum translation.
Fix some bugs in table->enum translation.