Fix first of a slew of minor bugs.