fix some cut and paste bugs