Clean up error messages and some old variables