Made some bug fixes.  Still not correct.