Fix grace period not being handled correctly