Improving the quality of astronomical survey data