Fixed menu bug and seems to handle compound queries correctly