Fix for divide by zero in TPS command

Signed-off-by: Ross Allan <rallanpcl@gmail.com>