Fixed test bugs