Update7

Small updates to test programs: new det-id, "bytoken" and some code cleanup.
Only test code affected.