Small fixes and updated querygen.