Bug fix: factor is the sum of two columns

Also
* use pseudo-inverse instead of inverse in vcov so that it works for
  singular matrices
* db.q prints the SQL query if errors out