Fixing bugs of the previous commit.