Catch an IndexOutOfBoundsException when saving post content.

Fixes #797 and #801