fix NPE that is thrown in copy to/from if reference is used in properties

(cherry picked from commit 0c55bdbfd7a34f259f9763bdb8fe37e07a42800d)

Conflicts:
	CHANGES.txt