Fixed test issues and failing test