Bug fix with string reallocation