Fixed quitting, increased test coverage, refactor