One fix and two unrelated proposals.

The first commit could fix some NPE (which may have never happened, nonetheless the code was wrong).

The second is my proposal for my favorite configuration option.

The third is the simplest way for handling issue 592.