Allow `null` to be provided as the default value

This allows the default value to be set to `null`. Without this change it fails because `typeof null === 'object'`, and objects are not allowed as the default value. I also updated the tests to test this behavior.