Improved logic for removing empty optional fields.