Latest fixes to script.
Minor bug fixes.
Minor bug fixes.