Fixing issue with divbyzero