Add tests for org-mode, and fix a bug in #136