Reducing path if too long (fixing issue #151)