Update function handle zeroes.

Added code to detect zeroes and print them correctly.