Fix zero division error