Allow arbitrary primitive types for default values.

inspired by @rabovik 's implementation of PR #4.