Fixed up old import/export code. Also table creation code.