Added missing classes, fixed bugs.