fixed bug in KeyGenInline (it was completely broken)