Fix a bug that prefix keys get lost (#1803).