Null fields fixes

This patch fixes some problems with null fields returned by the server