corrected some minor bugs