fixed lots of testing bugs