We study the performance of quantum annealing for two sets of problems, namely, 2-satisfiability (2-SAT) problems represented by Ising-type Hamiltonians, and nonstoquastic problems which are obtained by adding extra couplings to the 2-SAT problem Hamiltonians. In addition, we add to the transverse Ising-type Hamiltonian used for quantum annealing a third term, the trigger Hamiltonian with ferromagnetic or antiferromagnetic couplings, which vanishes at the beginning and end of the annealing process. We also analyze some problem instances using the energy spectrum, average energy or overlap of the state during the evolution with the instantaneous low lying eigenstates of the Hamiltonian, and identify some non-adiabatic mechanisms which can enhance the performance of quantum annealing.