A bunch of fixes for multi-keys

These need tests