fix(core): fix many bugs