Fixes to TEC fitting