Fix for special keys getting stolen by history function