corrected a couple of minor bugs