Fixed bugs introduced in the previous commit.