fixed couple of issues with composite keys; added more unit tests