First round of fixes