Fixed reference error and changed some memcpy's to assignments.
Updated a stringstream assignment, since that method has apparently been deleted some places.