Some serious fixes