Fix the addition of ?q= in some cases