Added tests for multi-part keys. A couple of fixes found by the unit tests.