Allow functions to generate the default value, fixes #50