Fix pylint errors and delete commented code