Merge "Fix string copy termination" into pi-dev