Fixed two bugs introduced with the last commit.