Fix spurious error when locating post.

The comment explains quite well.

Other change is just formatting.