Corrected various mistakes; added support for tables.