A whole lot of fixes