Fix missing identity encoding when q=0 exists