added new tests of swap and insert, with bug fixes to match