Fixes and optimalizations in tabs and tables