[core] Integrated frontend, fixed some bugs.