Fixed two bugs that cropped up in previous commit.