Fixed tests and better object handling

TODO: Perhaps add some custom Object id handling? in a separate custom
id map or in some other way.