Free nonces structure outside function check_nonces. Fix periodic EMR interval