fixed flaws with tests