Fixing assorted bugs, adding a new (currently somehwat broken) cog move.