Fix some bugs + added class cModel