Fixed HasEnabled compile bugs and other code missing.