fix division by zero in percent printing