fix qp code so it builds on mac