Only set kwargs as attributes if not None