small fixes of conditions
Fix bug where addTable crashes when called a second time with the same table
First working repair run