Better error handling: clear cache if an error occured, better error reporting with min files.