Fixed unit testing system (there were several serious flaws)