Fixed a bug in getting relative path in some environments