Move spi_object_append_null_reference and adjust its usage