Fixed some minor bugs in several classes.