fix various errors