Added realloc function.