Make sure we to check that a table exists before trying to access it.  This fixes
a problem which occurs when a table is not available.