Fix names of queue functions, add monomorphization code.