Worked some more on fixing bugs