fixed warnings with division by 0