Fixed the returning of empty values when the returned type is a structure.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
Fixed the generation of 'ToInternal' to check for null only fields of a ref type.

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