Remove global last_key variable