fixing some singleton and test issues