first batch of fixes