Merge pull request #24 from r-e-d/master

Handle templated default value.
Factor out conditionals
Format
Crash less
Remove wrong assert.