Fix several reallocs