bugfix in table. Fixes #2139
fix tests