Moving least squares interpolation schemes are in widespread use as a tool for numerical analysis on scattered data. In particular, they are often employed when solving partial differential equations on unstructured meshes, which are typically needed when the geometry defining the domain is complex. It is known that such schemes can be singular if the data points in the stencil happen to be in certain special geometric arrangements, however little research has addressed this issue specifically. In this paper, a moving least squares scheme is presented which is an appropriate tool for use when solving partial differential equations in two dimensions, and the precise conditions under which singularities occur are identified. The theory is then applied in the form of a stencil building algorithm which automatically detects singular stencils and corrects them in an efficient manner, while attempting to maintain stencil symmetry as closely as possible. Finally, the scheme is used in a convection-diffusion equation solver, and the results of a number of simulations are presented.