Added parameters and fixed bug on recording seen keys.