corrected a couple of bugs