Unit tests and minor changes for Keyed