Fixed threading errors.  Seems to be running correctly.