Moved PATH setting and added debugging info.