Fixed bugs in classes.