Fix nasty expire bug

@dwoos can you review, merge and release if happy.