Updated to use Dagger.
Fixed bugs