Fixing a few bugs, and adding in some debug output for unsolved ones.