fixed in case no options given for generate_key

Since generate_keys has defaults, users are inclined to think they can just call the function without a paramater but it breaks if options is null.