Work on payment protocol for gate, other minor changes