Add 'return $this' on document properties setter

Improve memory management on documents