Fix for tps calculation