fixed minor bugs here and there