fixed some bugs from previous commit.