First batch of fixes