Cleanup the x-allocation functions