typo in didError - now passes JSLint
Allow defaultValue to be a function. Useful for instantiating dates as the current time