keyType now derived from first variable if not given in metadata session
state.