Add 'algorithm' option for key gen; fix bracket style.