Adding null checks to marshaller and unmarshaller methods