Merge pull request #323 from ddobrev/master

Moved the code for creating a ref object by value from the marshalling printer to a valid ctor by value
Replaced the usage of memcpy with a simple dereference assignment.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>