large scale fixes