Move psql version output to start. Fix flake8 problems.