Update pre-commit script to work a bit smoother