Added --key-dir argument