Attempt to fix the dim embed test case failure

It was crashing because it was accessing freed memory. Now at least, it doesn't crash any more...