Failing tests fixed