Command line options: validate better, and remove unnecessary restrictions. Backport of commit 991759.
Changed paths: