Fixed bug when opening tables when no records