Fix amend_period: either from or to can be nil