Set document using DefineProperty, not SetProperty.

You're suppose to use DefineProperty the first time, and I didn't,
and it almost worked, but not quite.
With DefineProperty, it works better, but still not 100% right.