Instead of using to_boolean, you can just use the OptBool option, and your value will always be either true or false (also validated).