Do not assume invalid options are of boolean type

Fixes part of #2308.