diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19ce20e932e09a8e5f795feb37128186f833416f..dd9d2a79a15fa5c98d7a7ad1029c6365793c768d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ PROJECT(Corpus2Library)
 
 set(corpus2_ver_major "1")
 set(corpus2_ver_minor "2")
-set(corpus2_ver_patch "0")
+set(corpus2_ver_patch "1")
 
 cmake_minimum_required(VERSION 2.8.0)
 
diff --git a/libcorpus2/io/cclwriter.cpp b/libcorpus2/io/cclwriter.cpp
index cd4c941c160d212c8ca463552b852aa676fbdaa5..4bfc898a817be34a104e24230fc6fd6798026af5 100644
--- a/libcorpus2/io/cclwriter.cpp
+++ b/libcorpus2/io/cclwriter.cpp
@@ -127,9 +127,20 @@ void CclWriter::paragraph_head()
 
 void CclWriter::paragraph_head(const Chunk& c)
 {
+	// in CCL format chunks may have at most two attributes:
+	// id (unique XML-style id) and type (typically p for paragraphs)
 	osi() << "<chunk";
-	BOOST_FOREACH(const Chunk::attr_map_t::value_type& v, c.attributes()) {
-		os() << " " << v.first << "=\"" << v.second << "\"";
+	if (c.has_attribute("id")) {
+		const std::string &val = c.get_attribute("id");
+		if (!val.empty()) {
+			os() << " id=\"" << val << "\"";
+		}
+	}
+	if (c.has_attribute("type")) {
+		const std::string &val = c.get_attribute("type");
+		if (!val.empty()) {
+			os() << " type=\"" << val << "\"";
+		}
 	}
 	os() << ">\n";
 }
diff --git a/libcorpus2/io/writer.h b/libcorpus2/io/writer.h
index 9e8978e02567f17032f4194f7e448f2664fca2bb..7168bb6d6ece4bb2af9b11670cc32364f6c62a0d 100644
--- a/libcorpus2/io/writer.h
+++ b/libcorpus2/io/writer.h
@@ -151,6 +151,10 @@ protected:
 		return indent_;
 	}
 
+	/**
+	 * Write indentation spaces to the output stream and return the stream
+	 * for writing. Convenience function useful when starting new lines
+	 * in the output. */
 	std::ostream& osi();
 
 private: