Fixing some issues with dot products causing dimension mismatch errors.

This happened before with some of my old code. I believe it may have been an update to scipy or numpy. Regardless, without these changes I was getting errors that said the shape of the arrays being broadcasted was incorrect. The network seems to work correctly given the changes in this commit.