Fixed some bugs. Added support for view classes.