Fix shared cache move method and add tests for shared cache