Fixed require confilct, fixed some bugs