Fixed segfault opening tables