Fix a couple of bugs introduced in recent commit.