Correctly set type and serialize correct value for References

Conflicts:
	CHANGELOG.md
ok. updated, seems more sane now. the type (when editing an existing property) is the type declared by the user (if it is omitted or deleted then  it is null and the value is auto detected)