fix test. add intregrity/uniqueness tests