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