Fix the bug that named enum could not be indexed.