Fixes issue where getKey() was called erroneously in main.