Fix cex writer bug

closes #92