some wholesale fixes