Corrected some bugs previous commit.