table: some fixes and improvements