Fixed intermittent DB errors

This version of psycopg2 fixes intermittent programming errors.
Cleaned up some unused packages too.