Fixed an error, where object handling crashed when objects had connections to nonexisting objects