Fix test cases. Note: this piece of code looks so much like Guice, is this a coincidence?