fixed most compilation problems