Fix lots of trivial bugs, and rethink checkBlock to create blocks when they're needed rather than check predecessors for each block