Improved formulation of the film mode matching method for mode field calculations in dielectric waveguides