Updated entity writer to write out empty array for null