Changes to accomodate RefScript.

These are changes I made after all for RefScript.