shouldn't it be 'min' not 'max'?  we do want to wake up even earlier than sleep time if next unban is closer