Fix lint errors (some of these were real errors in edge cases too)