Fix some errors in open_table