Fix previously  introduced bugs