Minor changes to qgram.cc