Ops revision (updated)

This supercedes #167. It includes the changes from that pull requested plus one additional one, and has been rebased with master.