Fix incorrect result of ``getmodpath`` method.