Fixing bugs from previous commit.