Fixing persistent id stuff