Fixed a bug where recursion skipped some nodes

Also a bunch of other minor things, but the way it recurses definitely
works. I'm gonna watch the lectures tomorrow to try and understand how
log likelihood works.