Fix divided by 0 error