grid bugfixes + table_of_contents bug