manual merge of John Schember's readonly table support