Fix lint errors and tests