Added table exists method, bugfix for migrating tables