Fixed some issues with ReferenceProperty

Added some (insufficient) tests