Fixed possible segfault by reverting to the key struct (again).