Modified code to avoid sending empty HashMaps.
New these are set as Null, and initialized when recieved.