Bulk of fixes