fix various exceptions