A finite point set in
$\mathbb{R}^d$ is in general position if no
$d + 1$ points lie on a common hyperplane. Let
$\alpha _d(N)$ be the largest integer such that any set of
$N$ points in
$\mathbb{R}^d$, with no
$d + 2$ members on a common hyperplane, contains a subset of size
$\alpha _d(N)$ in general position. Using the method of hypergraph containers, Balogh and Solymosi showed that
$\alpha _2(N) \lt N^{5/6 + o(1)}$. In this paper, we also use the container method to obtain new upper bounds for
$\alpha _d(N)$ when
$d \geq 3$. More precisely, we show that if
$d$ is odd, then
$\alpha _d(N) \lt N^{\frac {1}{2} + \frac {1}{2d} + o(1)}$, and if
$d$ is even, we have
$\alpha _d(N) \lt N^{\frac {1}{2} + \frac {1}{d-1} + o(1)}$. We also study the classical problem of determining
$a(d,k,n)$, the maximum number of points selected from the grid
$[n]^d$ such that no
$k + 2$ members lie on a
$k$-flat, and improve the previously best known bound for
$a(d,k,n)$, due to Lefmann in 2008, by a polynomial factor when
$k$ = 2 or 3 (mod 4).