Fixed some bugs that cropped up.