Fix Python issues marked by Ruff CI job
After adding a CI job that runs Ruff a few issues appeared. These should be simple fixes. We should fix these and then stop allowing the job to fail.
After adding a CI job that runs Ruff a few issues appeared. These should be simple fixes. We should fix these and then stop allowing the job to fail.