Fix Python version check, fix formatting