Fix sevveral exceptions