Correction some bugs.