Recursively replace empty objects with null