Refactored and fixed a few dispenser tests.