Fixed bugs in org-mode.

Should be getting patches submitted shortly.