Fixed a few table related bugs.