clear map file on error; trim spaces in manifest