Changed strncpy to memcpy