Fixed test log dir and a if statement