Fix modes setting (#1), CS and classes generation