Effects of impurities and lattice imperfections on the conductive properties of MoS2