Fixed the relocation function.