Fixed errors, caused by the division in extreme cases