Prevent NPE when calculating hash code
Changed handling of owned/referenced property type and units type -
fixes #411