Table file reader bugs fixed and tests written