Fix dump network

Some errors that were breaking things.

~~The backward pass still does not work (wrong Caffe::phase()), will look at it tomorrow.~~

Backward pass seems to work now (but note I haven't inspected the saved blobs yet).