Fixed overflow in results calculation