Fix bug with Rekey