Fixed divide by 0 warning