fix several niu bugs;