fixed compile errors

I ran this on GEM. These were all the fixes I needed to make it
compile. Now it compiles but doesn’t work yet. For some reason it isn’t
learning across calls to back propagation.