Fix secret key behavior