Fix functions for table manipulates