Modified some implementation code.