Bugfix: test for table before accessing