Fixing bugs in last commit.