Updated interface and fixed a few protocol bugs.