more bugfixes.  this project is now unstable.  needs reset and replanning.