More Debugging.

Fixed all the major bugs. I'm pretty sure the program is working as
intended now. I'm getting about a ~25% success rate after ~150
generations of training. The task is now to figure out how to improve
this.