fix documentation of cleanup.
clear inserted data only if primary key is given; added tests.