Fix slave memory allocation