Don't create empty managed objects

For managed objects if there is an empty representation it would create
an empty managed object, which would make validations fail. Now if the
representation is empty no object is created.