fix serialization for empty elements
add NullableTypeComputer to avoid NPE
avoid a few exceptions
small fixes
fix serialization of empty elements