Fixed queue index handling regression caused by my previous commit.