Use more of GetValueOrDefault
Add missing check for conditional attributes. Fixes #9225
Fix default parameters of nested generic types.
Add new test
Remove duplicate method