Fixed bugs introduced by last commit.