Debugging PG code

This is unfortunately a short section. If you do nonstandard problems, it is easy to make mistakes, and not so easy to find them.