Fixed bug where pwd was causing problems.
Fixed problem where it wasn't actually exiting when a sub-script was
asking to exit.