More data cleaning and error handling