Replaced the usage of memcpy with a simple dereference assignment