Fixed the bug mentioned in previous commit.