Various bug fixes.  Hopefully more stable.