support for composite foreign and primary keys
minor fixes