Changing external shell launch configs

The function that defines the current shell variable was out of
place and an output redirector was also fixed to provide the
proper stack trace when a test fails.