Fix switch on enum. Update to new type for replica references.