Huge number of boring fixes