Added composite key handling