Add classes

Add several classes and fix bugs.