Whole lot of fixes