Fixed a subtle bug when default=None.