Fixed Bugs In saving empty and invalid tables