latest fixes. Minor isues outstanding