Avoid divide-by-zero errors