Refine EncDemo.

Refine EncDemo according API changes.