Removed dependency on TWDIR environment variable