fix problem when cm / cmi is invoked in a symlinked folder using e.g. --directory (fix #638)
Merge pull request #639 from ros/symlinked_pwd

fix problem when cm / cmi is invoked in a symlinked folder