Fixed a local/global problem and a typo