Add check for the default values type

It should match the type of the option.
Merge pull request #435 from huwr/master

Check the type of the default