Better warning for unrecognised options.

Fixes #1693.