cope with composite keys better

Signed-off-by: Jan Dvořák <mordae@anilinux.org>