Yet more bug fixes.  Nearly working!