Make abbreviations work correctly with type-ahead

Fixes #1434