Update the code to make sure AM resource in CLC is always updated. And
some boundary case changes.