improved code generation for filling tables.