Properly initialize strings after allocating memory