Prevent override of critical $path variable.
Do not print error if dir stack is too small.
Fix a few inclusion order problems.